package com.magic.gre.ui.popupwindow;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.magic.gre.R;
import com.magic.gre.base.popupwindow.BasePopupWindow;
import com.magic.gre.helper.Apphelper;

/**
 * Author: Lmoumou
 * Date: 2019-01-17 20:57
 * 文件名: VoicePopup
 * 描述:
 */
public class VoicePopup extends BasePopupWindow {

    private TextView mTextView;

    public VoicePopup(Context context) {
        super(context);
    }

    @Override
    public int getLayout() {
        return R.layout.popup_voice;
    }

    @Override
    public void initBase() {
        mTextView = getContentView().findViewById(R.id.mTextView);
        mTextView.setSelected(Apphelper.getVoice());
        mTextView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                v.setSelected(!v.isSelected());
                Apphelper.putVoice(v.isSelected());
            }
        });
    }
}
